package container

import (
	"fmt"
	// "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
)

type AliyunECS struct {
	// client *ecs.Client
}

func NewAliyunECS(region, accessKeyID, accessKeySecret string) *AliyunECS {
	// 初始化阿里云 ECS 客户端
	// client, err := ecs.NewClientWithAccessKey(region, accessKeyID, accessKeySecret)
	// if err != nil {
	//     panic(err)
	// }
	return &AliyunECS{
		// client: client,
	}
}

func (a *AliyunECS) StartInstance(instanceID string) error {
	fmt.Println("Starting instance on Aliyun ECS:", instanceID)
	// req := ecs.CreateStartInstanceRequest()
	// req.InstanceId = instanceID
	// _, err := a.client.StartInstance(req)
	return nil
}

func (a *AliyunECS) StopInstance(instanceID string) error {
	fmt.Println("Stopping instance on Aliyun ECS:", instanceID)
	// req := ecs.CreateStopInstanceRequest()
	// req.InstanceId = instanceID
	// _, err := a.client.StopInstance(req)
	return nil
}

func (a *AliyunECS) RestartInstance(instanceID string) error {
	fmt.Println("Restarting instance on Aliyun ECS:", instanceID)
	// req := ecs.CreateRebootInstanceRequest()
	// req.InstanceId = instanceID
	// _, err := a.client.RebootInstance(req)
	return nil
}
